from copy import deepcopy
from typing import List


def print_list(course: List[str]):
    course[0] = "lewen"
    print(course)


#  引用传递
courses = ["django", "go"]

# print_list(courses)
print_list(deepcopy(courses))
sublist = courses[1:4]  # 切出来的都是list # 新的list ,底层的数组是复制出来的
print(type(sublist))
print(type(courses))
print(courses)

if "lewen" in courses:
    print("ok")

a = [1, 2, 3]
b = a[:]
b[0] = 4
print(a)
print(b)

# Python 的list 进行切片后，反回的是新的list 和原来的是没有影响的
